﻿using mozhi.smarterp.BasicData.Enums;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using Volo.Abp;

namespace mozhi.smarterp.BasicData.ExpenseItems
{
    public class ExpenseItem : AggregateRootBase
    {
        public ExpenseItemType Type { get; private set; }

        public ExpenseItem(Guid id, string code, string name, ExpenseItemType type , bool activated) : base(id, code, name , activated)
        {
            Type = type;
            Validate();
        }

        public void Change(string code, string name, ExpenseItemType type, bool activated)
        {
            Code = code;
            Name = name;
            Activated = activated;

            Validate();
        }

        #region
        protected override void Validate()
        {
            base.Validate();

            Check.NotDefaultOrNull<ExpenseItemType>(Type , nameof(Type));
        }
        #endregion
    }
}
